'use strict';
const BaseController = require('./base');
const serviceName = 'conversation';
// 继承baseController 并且指定serviceName
class RouterController extends BaseController {
    constructor(ctx) {
        super(ctx, serviceName);
    }
    async index() {
        const { query, service } = this.ctx;
        let { pageNum, pageSize } = query;
        let page = Number(pageNum) || 1;
        let size = Number(pageSize) || 10;
        delete query.pageNum
        delete query.pageSize
        const list = await service[this.serviceName].getPage(this.getPageQuery(query), page, size);
        this.ctx.success(list);
    }
}
module.exports = RouterController;
